﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Profile_of_Student.aspx.cs" Inherits="_Default" MasterPageFile="~/Admin/Administrator.master" Title = "Profile of Student Page"%>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.2, Version=11.2.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent" >
    <p>
           
        <dx:ASPxGridView ID="gvwStudent" runat="server" AutoGenerateColumns="False" 
            Caption="List of Student" CssFilePath="~/App_Themes/DevEx/{0}/styles.css" 
            CssPostfix="DevEx" DataSourceID="SqlDataSource1" KeyFieldName="StudentID" 
            Width="100%" onrowvalidating="gvwStudent_RowValidating">
            <Columns>
                <dx:GridViewCommandColumn VisibleIndex="0">
                    <EditButton Visible="True">
                    </EditButton>
                    <NewButton Visible="True">
                    </NewButton>
                    <DeleteButton Visible="True">
                    </DeleteButton>
                    <UpdateButton Text="Save">
                    </UpdateButton>
                    <ClearFilterButton Visible="True">
                    </ClearFilterButton>
                </dx:GridViewCommandColumn>
                <dx:GridViewDataTextColumn FieldName="StudentID" VisibleIndex="1">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Password" VisibleIndex="2">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Firstname" VisibleIndex="3">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Lastname" VisibleIndex="4">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataComboBoxColumn FieldName="Gender" VisibleIndex="5">
                    <PropertiesComboBox IncrementalFilteringMode="Contains">
                        <Items>
                            <dx:ListEditItem Text="Male" Value="Male" />
                            <dx:ListEditItem Text="Female" Value="Female" />
                        </Items>
                    </PropertiesComboBox>
                </dx:GridViewDataComboBoxColumn>
                <dx:GridViewDataDateColumn FieldName="Birthdate" VisibleIndex="6">
                </dx:GridViewDataDateColumn>
                <dx:GridViewDataTextColumn FieldName="Address" VisibleIndex="7">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Phone" VisibleIndex="8">
                </dx:GridViewDataTextColumn>
                <dx:GridViewDataTextColumn FieldName="Email" VisibleIndex="9">
                </dx:GridViewDataTextColumn>
            </Columns>
            <Settings ShowFilterRow="True" ShowTitlePanel="True" />
            <Images SpriteCssFilePath="~/App_Themes/DevEx/{0}/sprite.css">
                <LoadingPanelOnStatusBar Url="~/App_Themes/DevEx/GridView/StatusBarLoading.gif">
                </LoadingPanelOnStatusBar>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </Images>
            <ImagesFilterControl>
                <LoadingPanel Url="~/App_Themes/DevEx/GridView/Loading.gif">
                </LoadingPanel>
            </ImagesFilterControl>
            <Styles CssFilePath="~/App_Themes/DevEx/{0}/styles.css" CssPostfix="DevEx">
                <Header ImageSpacing="5px" SortingImageSpacing="5px">
                </Header>
                <LoadingPanel ImageSpacing="5px">
                </LoadingPanel>
            </Styles>
            <StylesEditors ButtonEditCellSpacing="0">
                <ProgressBar Height="21px">
                </ProgressBar>
            </StylesEditors>
        </dx:ASPxGridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            
            ConnectionString="<%$ ConnectionStrings:Institte_of_Fine_ArtsConnectionString %>" DeleteCommand="DELETE FROM [Student] WHERE [StudentID] = @StudentID" 
            InsertCommand="INSERT INTO [Student] ([StudentID], [Password], [Firstname], [Lastname], [Gender], [Birthdate], [Address], [Phone], [Email]) VALUES (@StudentID, @Password, @Firstname, @Lastname, @Gender, @Birthdate, @Address, @Phone, @Email)" 
            SelectCommand="SELECT * FROM [Student]" 
            UpdateCommand="UPDATE [Student] SET [Password] = @Password, [Firstname] = @Firstname, [Lastname] = @Lastname, [Gender] = @Gender, [Birthdate] = @Birthdate, [Address] = @Address, [Phone] = @Phone, [Email] = @Email WHERE [StudentID] = @StudentID">
            <DeleteParameters>
                <asp:Parameter Name="StudentID"/>
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="StudentID"/>
                <asp:Parameter Name="Password"/>
                <asp:Parameter Name="Firstname"/>
                <asp:Parameter Name="Lastname"/>
                <asp:Parameter Name="Gender"/>
                <asp:Parameter Name="Birthdate"/>
                <asp:Parameter Name="Address"/>
                <asp:Parameter Name="Phone"/>
                <asp:Parameter Name="Email"/>
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="Password" />
                <asp:Parameter Name="Firstname"  />
                <asp:Parameter Name="Lastname"  />
                <asp:Parameter DefaultValue="" Name="Gender" />
                <asp:Parameter Name="Birthdate"/>
                <asp:Parameter Name="Address" />
                <asp:Parameter Name="Phone" />
                <asp:Parameter Name="Email"/>
                <asp:Parameter Name="StudentID" />
            </UpdateParameters>
        </asp:SqlDataSource>
         <dx:ASPxLabel ID="lbGender" runat="server" ClientInstanceName="lbGender" 
            AssociatedControlID="gvwStudent">
        </dx:ASPxLabel>
           
    </p>
</asp:Content>